<?php


namespace app\admin\business;


use app\common\model\Message;
use think\Exception;

class messageBus
{
    public $messageModel = null;
    public function __construct()
    {
        $this->messageModel = new Message();
    }

    public function getListPageBus($paging){
        $res = $this->messageModel->getAllList($paging);
        return $res;
    }
    public function getDetailByWhereBus($where){
        $res = $this->messageModel->getDetailByWhere($where);
        if (empty($res)){
            throw new Exception('无法查看或者已删除');
        }
        return $res;
    }
    public function removeByWhereBus($where){
        $res = $this->messageModel->removeByWhere($where);
        if (empty($res)){
            throw new Exception('删除失败');
        }
        return $res;
    }
}